package com.aba.cms5zu.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5 {
	    public static void main(String[] args) {
	        String input = "1262030265";
	        
	        try {
	            // Create MessageDigest instance for MD5
	            MessageDigest md = MessageDigest.getInstance("MD5");
	            
	            // Add input bytes to digest
	            md.update(input.getBytes());
	            
	            // Get the hash's bytes
	            byte[] bytes = md.digest();
	            
	            // Convert bytes to hex format
	            StringBuilder sb = new StringBuilder();
	            for (byte b : bytes) {
	                sb.append(String.format("%02x", b));
	            }
	            
	            // Get complete hashed string in hex format
	            String md5Hash = sb.toString();
	            
	            System.out.println("MD5 hash of \"" + input + "\": " + md5Hash);
	        } catch (NoSuchAlgorithmException e) {
	            // MD5 should always be available, but handle just in case
	            e.printStackTrace();
	        }
	    }
}
